package com.tiyende.kash.loop.configs

import androidx.appcompat.app.AppCompatDelegate
import com.tiyende.kash.loop.utils.shared.TiyendeSharedHelper
import com.tiyende.kash.loop.utils.shared.TiyendeSharedKey

/**
 * Configs
 * @Author wwdeng
 * @CreateTime: 2024/12/5 10:59
 * @Annotation：APP 配置
 */
object TiyendeConfigs {

    /**
     * APP 名称
     */
    const val TIYENDE_APPNAME = "TIYENDEKASH"

    /**
     * 包名
     */
    const val TIYENDE_PACKAGENANME = "com.tiyendekash.safeloan.onlinetapp"

    /**
     * 隐私协议
     */
    const val TIYENDE_PRIVACY_POLICY_LINK = "https://sites.google.com/zoeinfotech.online/tiyende-kash"

    /**
     * Adjust
     */
    const val TIYENDE_ADJ_TOKEN = "uxp5gfyshk3k"

    /**
     * 获取加解密Key
     */
    fun getSecretKey(): String{
        return TiyendeSharedHelper.queryTiyendeSharedString(TiyendeSharedKey.TIYENDE_SECRET_KEY)
    }

    /**
     * 获取加解密IV
     */
    fun getSecretIv(): String{
        return TiyendeSharedHelper.queryTiyendeSharedString(TiyendeSharedKey.TIYENDE_SECRET_IV)
    }

    /**
     * 是否是法语地区
     *  desc：地区转发（timeZone） 以 fcfa、xaf、senegal、benin 结尾，则定义为法语地区
     */
    fun isFrench(): Boolean{
        val timeZone = TiyendeSharedHelper.queryTiyendeSharedString(TiyendeSharedKey.TIYENDE_TIMEZONE)
        return timeZone.endsWith("fcfa") || timeZone.endsWith("xaf") || timeZone.endsWith("senegal") || timeZone.endsWith("benin")
    }

    /**
     * 印度  91
     */
    fun isIndia(): Boolean{
        val timeZone = TiyendeSharedHelper.queryTiyendeSharedString(TiyendeSharedKey.TIYENDE_TIMEZONE)
        return timeZone.endsWith("india")
    }

    /**
     * 是否是斯瓦西里语
     */
    fun isSwahili(): Boolean{
//        if (isTanz()) {
//            val curtLocale = Languages.getAppLanguage(MyApps.app.getAppContext())
//            when (curtLocale.language) {
//                LocaleContract.getSwahiliLocale().language -> {//坦桑
//                    return true
//                }
//            }
//        }
        return false
    }

    /**
     * 是否是印地语
     */
    fun isHindi(): Boolean{
        return AppCompatDelegate.getApplicationLocales()[0]?.language == "hi"
    }

}